package com.yckj.day06;

/**
 * TODO 测试为什么要封装
 *
 * @author shengyuee
 * @version 1.0
 * 2025/7/23 15:45
 */
public class PersonTest2 {
    public static void main(String[] args) {
        Person person = new Person();
        person.name = "张三";
        person.age = -10; // age没有封装直接访问，赋值负数，不合理
        System.out.println(person.name+","+person.age);
    }
}
